<?php get_header(); ?>
        <div id="slider" class="carousel slide" data-ride="carousel">
          <!-- Indicators -->
          <ol class="carousel-indicators">
            <li data-target="#slider" data-slide-to="0" class="active"></li>
            <li data-target="#slider" data-slide-to="1"></li>
            <li data-target="#slider" data-slide-to="2"></li>
          </ol>

          <!-- Wrapper for slides -->
          <div class="carousel-inner">
            <div class="item active">
              <img src="<?php echo bloginfo('template_directory'); ?>/images/slide1.png" alt="slide1">
            </div>
            <div class="item">
              <img src="<?php echo bloginfo('template_directory'); ?>/images/slide2.png" alt="slide2">
            </div>
            <div class="item">
              <img src="<?php echo bloginfo('template_directory'); ?>/images/slide3.png" alt="slide3">
            </div>
          </div>
      	</div><!-- /slider -->

    <div class="row" id="content">
	<?php get_sidebar(); ?>
		<div class="col-md-9 main-content">
            <!-- Nav tabs -->
            <ul class="nav nav-tabs" role="tablist">
              <li class="active"><a href="#new" role="tab" data-toggle="tab">Sản Phẩm Mới</a></li>
              <li><a href="#popular" role="tab" data-toggle="tab">Sản Phẩm Phổ Biến</a></li>
              <li><a href="#sale" role="tab" data-toggle="tab">Sản Phẩm Khuyến Mãi</a></li>
            </ul>

            <!-- Tab panes -->
            <div class="tab-content">
              <div class="tab-pane active" id="new">
                <div class="row">
                  <?php
                  $args = array(
                      'posts_per_page' => 6,
                      'post_type' => 'product',
                      'orderby' => 'ID',
                      'order' => 'DESC'
                  );
                  $loop = new WP_Query($args);
                  while($loop->have_posts()):$loop->the_post();global $product; ?>
                    <div class="col-md-4">
                      <div class="main-product">
                       <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail(); ?></a>
                      <span class="price"><?php echo $product->get_price_html(); ?></span>
                      <h3 class="title"><?php the_title(); ?></h3>
                      <?php woocommerce_template_loop_add_to_cart( $loop->post, $product ); ?>
                      <a href="<?php the_permalink(); ?>" class="link-detail">Xem Chi Tiết <span class="glyphicon glyphicon-play"></span></a>
                    </div>
                  </div>
                  <?php endwhile;wp_reset_query();?>  
                </div>
              </div>
              <div class="tab-pane" id="popular">
                <div class="row">
                  <?php
                  $args = array(
                      'posts_per_page' => 6,
                      'post_type' => 'product',
                      'orderby' => 'comment_count',
                      'order' => 'DESC'
                  );
                  $loop = new WP_Query($args);
                  while($loop->have_posts()):$loop->the_post();global $product; ?>
                    <div class="col-md-4">
                      <div class="main-product">
                       <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail(); ?></a>
                      <span class="price"><?php echo $product->get_price_html(); ?></span>
                      <h3 class="title"><?php the_title(); ?></h3>
                      <?php woocommerce_template_loop_add_to_cart( $loop->post, $product ); ?>
                      <a href="<?php the_permalink(); ?>" class="link-detail">Xem Chi Tiết <span class="glyphicon glyphicon-play"></span></a>
                    </div>
                  </div>
                  <?php endwhile;wp_reset_query();?> 
                </div>
              </div>
              <div class="tab-pane" id="sale">
                <div class="row">
                  <?php
                  $args = array(
                      'post_type'      => 'product',
                      'posts_per_page' => 6,
                      'order'          => 'ASC',
                      'paged'          => $paged,
                      'meta_query'     => array(
                          array(
                              'key'           => '_sale_price',
                              'value'         => 0,
                              'compare'       => '>',
                              'type'          => 'numeric'
                          )
                      )
                  );
                  $loop = new WP_Query($args);
                  while($loop->have_posts()):$loop->the_post();global $product; ?>
                    <div class="col-md-4">
                      <div class="main-product">
                       <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail(); ?></a>
                      <span class="price"><?php echo $product->get_price_html(); ?></span>
                      <h3 class="title"><?php the_title(); ?></h3>
                      <?php woocommerce_template_loop_add_to_cart( $loop->post, $product ); ?>
                      <a href="<?php the_permalink(); ?>" class="link-detail">Xem Chi Tiết <span class="glyphicon glyphicon-play"></span></a>
                    </div>
                  </div>
                  <?php endwhile;wp_reset_query();?> 
                </div>
              </div>
            </div>
          </div>
	</div><!-- /content -->
<?php get_footer(); ?>